{extend name="public:default" /}

<!-- 行工具栏 -->
{block name="tableEndBtn"}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit"><i class="layui-icon"></i></a>
{/block}


{block name="script"}
    <script>
        var editList = window.location.pathname;
        var editAdd = editList + 'Add';
        var editDel = editList + 'Del';
        var editUp  = editList + 'Up';

        views.setUrl(editAdd,editDel,editUp).cols({
            url:editList,
            page:true,

            cols : [
                {type:'checkbox' , fixed: 'left'}

                ,{field:'id',title :"ID",align:'center'}
                ,{field:'img_url',title :"轮播图片",align:'center' , event:'img',width:100,templet:function(d){ return d.img_url ? '<img src="'+d.img_url+'" width="100%">' : '暂无图片'}}
                ,{field:'banner_is_show',title:'是否显示',algin:'center' , 
                templet:function(d){
                    return d.banner_is_show == 1 ? '是' : '否';
                }
            } 
                ,{field:'time',title:'添加时间',algin:'center' , templet:function(d){ return d.time ? layui.util.toDateString(d.time * 1000) : '' ; }}
                ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:150}
            ]
        }).toolbar(function(obj,data,table){
            // 头工具栏事件

        }).tool(function(obj,table){
            //监听行工具事件

        }).get();
    </script>
{/block}